/**
 * Author:   .
 * Date:    2017/7/5 0005.
 * File：   pc类.
 */
import BaseNative from './BaseNative'
import config from '../config'
import * as storage from '../storage'
import {Toast} from 'mint-ui'

class PcNative extends BaseNative {
  getType() {
    return 'PcNative'
  }
  /***
   * 微信支付
   * @param param {paySn: ''}
   * @return {Promise}
   */
  // async weixinPay(param) {
  //   let order = await request.getWxPayOrder(param.paySn)
  //   return this.pay(0, order)
  // }
  weixinPay(param) {
    let paySn = param.paySn
    let key = storage.getKey()
    if (!key || key == '') {
      Toast('请先注册')
      return
    }
    let url = config.website + '/mobile/index.php?act=member_payment&op=pay&key=' + key + '&pay_sn=' + paySn + '&payment_code=h5wxpay'
    window.location.href = url
  }
}

export default PcNative